#if !defined(AFX_OCXDEMOCTL_H__66BB8B4A_59F7_4D48_A21C_FD9EBAA7A110__INCLUDED_)
#define AFX_OCXDEMOCTL_H__66BB8B4A_59F7_4D48_A21C_FD9EBAA7A110__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// OCXDemoCtl.h : Declaration of the COCXDemoCtrl ActiveX Control class.

/////////////////////////////////////////////////////////////////////////////
// COCXDemoCtrl : See OCXDemoCtl.cpp for implementation.

class COCXDemoCtrl : public COleControl
{
	DECLARE_DYNCREATE(COCXDemoCtrl)

// Constructor
public:
	COCXDemoCtrl();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(COCXDemoCtrl)
	public:
	virtual void OnDraw(CDC* pdc, const CRect& rcBounds, const CRect& rcInvalid);
	virtual void DoPropExchange(CPropExchange* pPX);
	virtual void OnResetState();
	//}}AFX_VIRTUAL

// Implementation
protected:
	~COCXDemoCtrl();

	DECLARE_OLECREATE_EX(COCXDemoCtrl)    // Class factory and guid
	DECLARE_OLETYPELIB(COCXDemoCtrl)      // GetTypeInfo
	DECLARE_PROPPAGEIDS(COCXDemoCtrl)     // Property page IDs
	DECLARE_OLECTLTYPE(COCXDemoCtrl)		// Type name and misc status

// Message maps
	//{{AFX_MSG(COCXDemoCtrl)
		// NOTE - ClassWizard will add and remove member functions here.
		//    DO NOT EDIT what you see in these blocks of generated code !
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()

// Dispatch maps
	//{{AFX_DISPATCH(COCXDemoCtrl)
	afx_msg BOOL initDB(LPCTSTR dbFullPath);
	afx_msg BOOL checkTableExists(LPCTSTR tbName);
	afx_msg BSTR getDBFullPath();
	afx_msg BSTR getDBName();
	afx_msg BSTR execDBQuery(LPCTSTR sql);
	afx_msg BSTR getDBPath();
	//}}AFX_DISPATCH
	DECLARE_DISPATCH_MAP()

// Event maps
	//{{AFX_EVENT(COCXDemoCtrl)
	//}}AFX_EVENT
	DECLARE_EVENT_MAP()

// Dispatch and event IDs
public:
	enum {
	//{{AFX_DISP_ID(COCXDemoCtrl)
	dispidInitDB = 1L,
	dispidCheckTableExists = 2L,
	dispidGetDBFullPath = 3L,
	dispidGetDBName = 4L,
	dispidExecDBQuery = 5L,
	dispidGetDBPath = 6L,
	//}}AFX_DISP_ID
	};
	
private:
	const char * CreateTag;
	const char * ReBuildSQL;
	CString		m_dbFullPath;
	CString		m_dbPath;
	CString		m_dbName;
private:
	void SplitDBFullPath(CString dbFullPath);

	void GetJsonByData(CppSQLite3Query query, CString & dataResult);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_OCXDEMOCTL_H__66BB8B4A_59F7_4D48_A21C_FD9EBAA7A110__INCLUDED)
